package com.szit.adminserver.dao;

import com.szit.adminserver.entity.AdminPermission;
import com.szit.adminserver.entity.AdminRole;
import com.szit.util.vo.AdminRoleVo;

import java.util.ArrayList;

public interface AdminRoleMapper {
    int deleteByPrimaryKey(Integer roleId);

    int insert(AdminRole record);

    int insertSelective(AdminRole record);

    AdminRole selectByPrimaryKey(Integer roleId);

    int updateByPrimaryKeySelective(AdminRole record);

    int updateByPrimaryKey(AdminRole record);

    /**
     * 根据userId查找对应的权限orders
     * @param userId
     * @return
     */
    Long selectOrdersByUserId(Integer userId);

    /**
     * 根据name查找
     * @param name
     * @return
     */
    AdminRole selectByName(String name);

    /**
     * 查询所有角色
     * @return
     */
    ArrayList<AdminRole> selectAllAdminRole();

    /**
     * 查询所有角色跟权限id
     * @return
     */
    ArrayList<AdminRoleVo> selectPermissionIdAndAllAdminRole();

}